<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
import HelloWorld from './components/HelloWorld.vue'
</script>

<template>
  <header>
    <h1>设计模式示例</h1>
    <nav>
      <RouterLink to="/">享元模式</RouterLink>
      <RouterLink to="/facade">外观模式</RouterLink>
    </nav>
  </header>

  <main>
    <RouterView />
  </main>
</template>

<style scoped>
header {
  background-color: #f8f9fa;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav {
  margin-top: 1rem;
}

nav a {
  margin: 0 1rem;
  color: #2c3e50;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s;
}

nav a:hover {
  background-color: #e9ecef;
}

nav a.router-link-active {
  background-color: #e9ecef;
  font-weight: bold;
}

main {
  padding: 1rem;
}
</style>
